<template>
	<view class="page">
		<view class="img-view"
			style="background: url(https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b4b60b10-5168-11eb-bd01-97bc1429a9ff.jpg);background-size: 100% 100%;">
			<!-- 	<image :src="imgUrls[0]"></image> -->
			<view class="" style="padding: 150rpx 26rpx 26rpx 26rpx;z-index: 999;">
				<view class="" style="width: 40%;">
					<image :src="src" class="headImg"></image>
					<view class="" style="color: #f3f5f7;float: right;">
						<p style="font-size:24rpx;">徐鑫 | 主治医生</p>
						<text style="font-size: 18rpx;">上海 32岁</text>
					</view>
				</view>
				<view class="u-flex" style="width: 40%;">
					<!-- 我的关注 -->
					<view class="u-flex-1" @click="openinfo('/pages/tabBar/my/myFreshRun/myFreshRun')">
						<p class="number">15</p>
						<p class="text">关注</p>
					</view>
					<!-- 我的粉丝 -->
					<view class="u-flex-1" @click="openinfo('/pages/tabBar/my/myFun')">
						<p class="number">597</p>
						<p class="text">粉丝</p>
					</view>
					<view class="u-flex-1" @click="openPop()">
						<p class="number">2.6w</p>
						<p class="text">获赞与收藏</p>
					</view>
					<view class="" style="float: right;">
						<u-button shape="circle" size="mini" :plain="true">已关注</u-button>
					</view>
				</view>
			</view>
		</view>
		<view class="wrap" style="">
			<view class="u-tabs-box">
				<u-tabs-swiper activeColor="#44a3ff" ref="tabs" :list="list" :current="current" @change="change"
					:is-scroll="false" swiperWidth="750"></u-tabs-swiper>
			</view>
			<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
				@animationfinish="animationfinish">
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						发文
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						收藏
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="page-box">
							赞过
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="page-box">
							评论
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<u-popup v-model="popupShow" mode="center" border-radius="14">
			<view style="padding: 0px 26rpx;text-align: center;width: 380rpx;">
				<view class="popTitle">
					获赞与收藏
				</view>
				<view class="">
					<view class="con_text">
						当前发布科普数 <text>21</text>
					</view>
					<view class="con_text">
						当前获得点赞数 <text>2.5w</text>
					</view>
					<view class="con_text">
						当前获得收藏数 <text>1.1w</text>
					</view>
				</view>
				<u-button type="primary" size="medium" shape="circle" @click="Ido()" style="margin-bottom: 26rpx;">我知道了
				</u-button>
			</view>
		</u-popup>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				imgUrls: [
					"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b4b60b10-5168-11eb-bd01-97bc1429a9ff.jpg",
					"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b1dcfa70-5168-11eb-bd01-97bc1429a9ff.jpg"
				],
				popupShow: false,
				src: './../../../../static/science/xyheadpng.png',
				list: [{
						name: '发文'
					},
					{
						name: '收藏'
					},
					{
						name: '赞过'
					},
					{
						name: '评论'
					}
				],
				current: 0,
				swiperCurrent: 0,
				tabsHeight: 0,
				dx: 0
			};
		},
		onLoad(e) {
			// 根据排序 入值
			console.log(e.index);
			this.current = e.index;
			this.swiperCurrent = e.index;
		},
		computed: {},
		methods: {
			openPop() {
				this.popupShow=true;
			},
			openinfo(url) {
				uni.navigateTo({
					url: url,
				});
			},
			// 我知道了
			Ido() {
				this.popupShow = false;
				console.debug("我知道了");
			},
			// tab栏切换
			change(index) {
				console.log(index);
				this.swiperCurrent = index;
			},
			transition({
				detail: {
					dx
				}
			}) {
				this.$refs.tabs.setDx(dx);
			},
			animationfinish({
				detail: {
					current
				}
			}) {
				this.$refs.tabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			}
		}
	}
</script>

<style lang="scss" scoped>
	/* #ifndef H5 */
	page {
		height: 100%;
		background-color: #f2f2f2;
	}

	/* #endif */
	.number {
		color: #f3f5f7;
		text-align: center;
	}

	.popTitle {
		border-bottom: 1rpx solid #f7f7f7;
		line-height: 80rpx;
		text-align: center;
	}

	.con_text {
		line-height: 60rpx;
	}

	.text {
		color: #9799a0;
		font-size: 16rpx;
		text-align: center;
	}

	.headImg {
		border: 1px solid #aaacb6;
		border-radius: 50%;
		width: 80rpx;
		height: 80rpx;
	}

	.bg {
		background-color: #FFFFFF;
	}

	.order {
		width: 710rpx;
		background-color: #ffffff;
		margin: 20rpx auto;
		border-radius: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		font-size: 28rpx;

		.top {
			display: flex;
			justify-content: space-between;

			.left {
				display: flex;
				align-items: center;

				.store {
					margin: 0 10rpx;
					font-size: 32rpx;
					font-weight: bold;
				}
			}

			.right {
				color: $u-type-warning-dark;
			}
		}

		.item {
			display: flex;
			margin: 20rpx 0 0;

			.left {
				margin-right: 20rpx;

				image {
					width: 200rpx;
					height: 200rpx;
					border-radius: 10rpx;
				}
			}

			.content {
				.title {
					font-size: 28rpx;
					line-height: 50rpx;
				}

				.type {
					margin: 10rpx 0;
					font-size: 24rpx;
					color: $u-tips-color;
				}

				.delivery-time {
					color: #e5d001;
					font-size: 24rpx;
				}
			}

			.right {
				margin-left: 10rpx;
				padding-top: 20rpx;
				text-align: right;

				.decimal {
					font-size: 24rpx;
					margin-top: 4rpx;
				}

				.number {
					color: $u-tips-color;
					font-size: 24rpx;
				}
			}
		}

		.total {
			margin-top: 20rpx;
			text-align: right;
			font-size: 24rpx;

			.total-price {
				font-size: 32rpx;
			}
		}

		.bottom {
			display: flex;
			margin-top: 40rpx;
			padding: 0 10rpx;
			justify-content: space-between;
			align-items: center;

			.btn {
				line-height: 52rpx;
				width: 160rpx;
				border-radius: 26rpx;
				border: 2rpx solid $u-border-color;
				font-size: 26rpx;
				text-align: center;
				color: $u-type-info-dark;
			}
		}
	}

	.centre {
		text-align: center;
		margin: 200rpx auto;
		font-size: 32rpx;

		image {
			width: 164rpx;
			height: 164rpx;
			border-radius: 50%;
			margin-bottom: 20rpx;
		}

		.tips {
			font-size: 24rpx;
			color: #999999;
			margin-top: 20rpx;
		}
	}

	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--window-top));
		width: 100%;
	}

	.swiper-box {
		flex: 1;
	}

	image,
	swiper,
	.img-view {
		width: 750rpx;
		width: 100%;
		height: 400rpx;
	}

	.page-section-title {
		margin-top: 50rpx;
	}
</style>
